AWS System Administration by Mike Ryan & Federico Lucifredi

AWS System Administration by Mike Ryan & Federico Lucifredi

Author:Mike Ryan & Federico Lucifredi
Language: eng
Format: epub
Publisher: O'Reilly Media, Inc.
Published: 2018-08-15T04:00:00+00:00


Example 5-7. Nginx Puppet module

class myblog::mynginx { class { "nginx": } nginx::resource::upstream { "myblog_app": ensure => present, members => [ 'localhost:8000', ] } nginx::resource::vhost { "blog.example.com": ensure => enable, listen_options => "default", proxy => "http://myblog_app" } }

Similar to the myblog::supervisor class, this class installs the Nginx package and writes the configuration file describing our desired Nginx setup. In this case, a single Nginx virtual host is created. This virtual host will proxy all traffic to the myblog_app proxy, which is running on port 8000.

Because we already have a class named nginx in the Nginx module, we can’t call our class myblog::nginx. Instead, we call it myblog::mynginx to prevent a naming collision.

Example 5-7 should be saved to puppet/modules/myblog/manifests/mynginx.pp.

The final piece of the puzzle is the myblog::web class, shown in Example 5-8.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.